/**
 * 获取class
 * @author zhu_shuai
 * @since 8/4
 */
public class Demo01Class {
    public static void main(String[] args) throws ClassNotFoundException {
        // 获取class的三种方式
        // 1. 类获取
        Class<User> userClass1 = User.class;
        // 2. 对象获取
        User user = new User();
        Class<User> userClass2 = (Class<User>) user.getClass();
        // 3. 全路径获取
        Class<User> userClass3 = (Class<User>) Class.forName("User");

        System.out.println(userClass1.hashCode());
        System.out.println(userClass2.hashCode());
        System.out.println(userClass3.hashCode());

    }
}
